package senpec.qc.harmony.system.department;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import senpec.qc.harmony.base.mybatisplus.IBaseControllerImpl;
import senpec.qc.harmony.base.mybatisplus.Result;

import java.util.List;

@RestController
@RequestMapping("/system/department")
public class DepartmentController extends IBaseControllerImpl<Department, DepartmentService> {

    private final DepartmentService departmentService;

    public DepartmentController(DepartmentService baseService, DepartmentService departmentService) {
        super(baseService);
        this.departmentService = departmentService;
    }

    @GetMapping("/getCascade")
    public Result<List<Department>> getCascade() {
        return departmentService.getCascade();
    }

    @Override
    public Result<List<Department>> getTree() {
        return departmentService.getTree();
    }
}